//
//  TKFrame.m
//  EasyKit
//
//  Created by zx on 2017/12/22.
//  Copyright © 2017年 a186f13. All rights reserved.
//

#import "TKFrame.h"

@interface TKFrame()

@property (nonatomic, strong) NSMutableArray *childFrames;

@end

@implementation TKFrame

- (instancetype)initWithFirstView:(UIView *)firstView frameAttribute:(TKFrameAttribute)frameAttribute
{
    self = [super init];
    if (self) {
        self.firstView = firstView;
        self.frameArrribute = frameAttribute;
    }
    return self;
}

- (instancetype)initWithFrameAttribute:(TKFrameAttribute)frameAttribute
{
    self = [super init];
    if (self) {
        self.frameArrribute = frameAttribute;
    }
    return self;
}

- (TKFrame *)left {
    return [self.delegate constraint:self addFrameAttribute:TKFrameAttributeLeft];
}

- (TKFrame *)top {
    return [self.delegate constraint:self addFrameAttribute:TKFrameAttributeTop];
}

- (TKFrame *)right {
    return [self.delegate constraint:self addFrameAttribute:TKFrameAttributeRight];
}

- (TKFrame *)bottom {
    return [self.delegate constraint:self addFrameAttribute:TKFrameAttributeBottom];
}

- (TKFrame *)leading {
    return [self.delegate constraint:self addFrameAttribute:TKFrameAttributeLeading];
}

- (TKFrame *)trailing {
    return [self.delegate constraint:self addFrameAttribute:TKFrameAttributeTrailing];
}

- (TKFrame *)width {
    return [self.delegate constraint:self addFrameAttribute:TKFrameAttributeWidth];
}

- (TKFrame *)height {
    return [self.delegate constraint:self addFrameAttribute:TKFrameAttributeHeight];
}

- (TKFrame *)centerX {
    return [self.delegate constraint:self addFrameAttribute:TKFrameAttributeCenterX];
}

- (TKFrame *)centerY {
    return [self.delegate constraint:self addFrameAttribute:TKFrameAttributeCenterY];
}

@end
